Optimal. Leaf size=107 \[ a^4 x+\frac {2 a b \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b^2 \left (17 a^2+2 b^2\right ) \tan (c+d x)}{3 d}+\frac {4 a b^3 \sec (c+d x) \tan (c+d x)}{3 d}+\frac {b^2 (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3867, 4133,
3855, 3852, 8} \begin {gather*} a^4 x+\frac {b^2 \left (17 a^2+2 b^2\right ) \tan (c+d x)}{3 d}+\frac {2 a b \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {4 a b^3 \tan (c+d x) \sec (c+d x)}{3 d}+\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3867
Rule 4133
Rubi steps
\begin {align*} \int (a+b \sec (c+d x))^4 \, dx &=\frac {b^2 (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{3} \int (a+b \sec (c+d x)) \left (3 a^3+b \left (9 a^2+2 b^2\right ) \sec (c+d x)+8 a b^2 \sec ^2(c+d x)\right ) \, dx\\ &=\frac {4 a b^3 \sec (c+d x) \tan (c+d x)}{3 d}+\frac {b^2 (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{6} \int \left (6 a^4+12 a b \left (2 a^2+b^2\right ) \sec (c+d x)+2 b^2 \left (17 a^2+2 b^2\right ) \sec ^2(c+d x)\right ) \, dx\\ &=a^4 x+\frac {4 a b^3 \sec (c+d x) \tan (c+d x)}{3 d}+\frac {b^2 (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}+\left (2 a b \left (2 a^2+b^2\right )\right ) \int \sec (c+d x) \, dx+\frac {1}{3} \left (b^2 \left (17 a^2+2 b^2\right )\right ) \int \sec ^2(c+d x) \, dx\\ &=a^4 x+\frac {2 a b \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {4 a b^3 \sec (c+d x) \tan (c+d x)}{3 d}+\frac {b^2 (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}-\frac {\left (b^2 \left (17 a^2+2 b^2\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=a^4 x+\frac {2 a b \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b^2 \left (17 a^2+2 b^2\right ) \tan (c+d x)}{3 d}+\frac {4 a b^3 \sec (c+d x) \tan (c+d x)}{3 d}+\frac {b^2 (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.32, size = 77, normalized size = 0.72 \begin {gather*} \frac {3 a^4 d x+6 a b \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))+3 b^2 \left (6 a^2+b^2+2 a b \sec (c+d x)\right ) \tan (c+d x)+b^4 \tan ^3(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 109, normalized size = 1.02
method | result | size |
derivativedivides | \(\frac {a^{4} \left (d x +c \right )+4 b \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+6 b^{2} a^{2} \tan \left (d x +c \right )+4 b^{3} a \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-b^{4} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(109\) |
default | \(\frac {a^{4} \left (d x +c \right )+4 b \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+6 b^{2} a^{2} \tan \left (d x +c \right )+4 b^{3} a \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-b^{4} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(109\) |
risch | \(a^{4} x -\frac {4 i b^{2} \left (3 b a \,{\mathrm e}^{5 i \left (d x +c \right )}-9 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 b a \,{\mathrm e}^{i \left (d x +c \right )}-9 a^{2}-b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {4 b \,a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {2 b^{3} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {4 b \,a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}+\frac {2 b^{3} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) | \(196\) |
norman | \(\frac {a^{4} x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a^{4} x +3 a^{4} x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-3 a^{4} x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {4 b^{2} \left (18 a^{2}+b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 b^{2} \left (6 a^{2}-2 b a +b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 b^{2} \left (6 a^{2}+2 b a +b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {2 b a \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 b a \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(221\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 121, normalized size = 1.13 \begin {gather*} a^{4} x + \frac {{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} b^{4}}{3 \, d} - \frac {a b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{d} + \frac {4 \, a^{3} b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right )}{d} + \frac {6 \, a^{2} b^{2} \tan \left (d x + c\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.47, size = 138, normalized size = 1.29 \begin {gather*} \frac {3 \, a^{4} d x \cos \left (d x + c\right )^{3} + 3 \, {\left (2 \, a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (2 \, a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (6 \, a b^{3} \cos \left (d x + c\right ) + b^{4} + 2 \, {\left (9 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{4}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 221 vs.
\(2 (101) = 202\).
time = 0.46, size = 221, normalized size = 2.07 \begin {gather*} \frac {3 \, {\left (d x + c\right )} a^{4} + 6 \, {\left (2 \, a^{3} b + a b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 6 \, {\left (2 \, a^{3} b + a b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (18 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 36 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 18 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.03, size = 185, normalized size = 1.73 \begin {gather*} \frac {2\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,b^4\,\sin \left (c+d\,x\right )}{3\,d\,\cos \left (c+d\,x\right )}+\frac {b^4\,\sin \left (c+d\,x\right )}{3\,d\,{\cos \left (c+d\,x\right )}^3}+\frac {4\,a\,b^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {8\,a^3\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,a\,b^3\,\sin \left (c+d\,x\right )}{d\,{\cos \left (c+d\,x\right )}^2}+\frac {6\,a^2\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________